<extend name="Public/base" />

<block name="style">
 <link href="__CSS__/freeshipping.min.css?v={:C('CURRENT_FILE_VERSION')}" rel="stylesheet" />
   
<style>
/*    .page-content{padding:15px 10px;}
    .search_pannl_div .single-col label{width:75px;}
body {
      padding: 0;
      font-family: Helvetica,'é»‘ä½“',Verdana,Arial,Helvetica,sans-serif;
      font-size: 1em;
      background: #eee;
      padding: 0;
      min-width: 320px;
      max-width: 640px;
      margin: 0 auto;
      overflow-x: hidden;
        }
table.tabtr{
            margin-bottom: 10px;
            border:1px solid #ddd;
            font-size: 14px;
            padding:10px;
            width: 100%;
        }
 button#suboffer {

   
}  
span#uploadimg{
   margin-bottom: -8px;
}  
*/

    .page-content{padding:0 10px; }
    .search_pannl_div .single-col label{width:75px;}
body {
      padding: 0;
      font-family: Helvetica,'é»‘ä½“',Verdana,Arial,Helvetica,sans-serif;
      font-size: 1em;
      background: #eee;
      padding: 0;
      min-width: 320px;
      max-width: 640px;
      margin: 0 auto;
      overflow-x: hidden;
        }
table.tabtr{
      border-top:1px solid #E5E5E5;
      border-bottom:1px solid #E5E5E5;
      font-size: 14px;
      padding:10px 20px;
      width: 100%;
      background-color:#FFFFFF;
        }
    .tabtr{ margin-top:10px;}
 button#suboffer {

   
}  
span#uploadimg{
   margin-bottom: -8px;
}  

.module_title{ font-size:16px !important; background-color:#FFFFFF !important;}
.tabtr tr{ text-align:left;}
.as{ width:26%; text-align:right;}
.as2{  padding-left:28%; }
.as, .as2{ font-weight:100 !important;}
.weui_panel_hd:after{ left:0 !important;     background-color:#cccccc !important;}
#fail{ background-color:#ff9d11 !important; margin:16px 0 22px;}


.scfp{ width:100%;}
.upload_submit_btn {  width:100px; display:block; height:21px; background-color:#5cac25; border:none; float:right; color:#FFFFFF; margin-bottom:30px; margin-top:4px;}

.fileselectclass{width:180px; display:block; height:21px; line-height:21px; background-color:#5cac25; border:none; float:left; margin-top:4px; color:#FFFFFF;}



.weui_panel{ background:none;}

</style>
</block>
<block name="body">
    <div class="weui_panel weui_panel_access">
        <div class="weui_panel_hd module_title">确认报价单</div>
        <div class="weui_panel_bd" id="tablists">
        <volist name="list" id="vo">
      
    <table class="tabtr">
        <tbody><tr> <th class="as">采购单名:</th><th class="as2">{$offername.purchaseame}</th></tr>
        <tr> <th class="as">商品名:</th><th class="as2">{$vo.goodsname}</th></tr>
         <tr> <th class="as">报价:</th><th class="as2">{$vo.offer_price}</th></tr>
         <tr> <th class="as">数量:</th><th class="as2">{$vo.offer_number}</th></tr>
         <tr> <th class="as">采纳数量:</th><th class="as2">{$vo.actual_number}</th></tr>  
     </tbody> 

<!--        
   <tr > <th>采购单名:</th><th>{$offername.purchaseame}</th></tr>
        <tr > <th>商品名:</th><th>{$vo.goodsname}</th></tr>
         <tr > <th>报价:</th><th>{$vo.offer_price}</th></tr>
         <tr > <th>数量:</th><th>{$vo.offer_number}</th></tr>
         <tr > <th>采纳数量:</th><th>{$vo.actual_number}</th></tr>  
       -->
          </table>
          </volist> 
           <tbody>
          <tr > <th>总价格:</th><th>{$sum_price}</th></tr>  
          </tbody> 
        </div>
   <!--      <form action="{:U('uploadoffer')}" method="post"  enctype="multipart/form-data">
          <span id='uploadimg' class='weui_btn weui_btn_mini weui_btn_primary'>上传发票</span>
          <button id="subimg" class="weui_btn weui_btn_mini weui_btn_primary">提交报价单</button>
        </form>   
        
        <img id="preview" width="150" height="150"> -->
    </div>
            <a href="{:U('Offer/user_fail',array(offerid=>$offerid))}" id="fail" class="weui_btn weui_btn_mini " onClick="return confirm('终止后将无法恢复,确定要终止?')" >终止交易</a>
    <form id="uploadForm" action='{:U("/Offer/uploadoffer",array("offerid"=>$offerid))}' method="post" enctype="multipart/form-data">
             <input type="file" class="fileselectclass" name="fileselect[]" mark = "last_file"/>
            <button type="submit" id="fileSubmit" class="upload_submit_btn " >确认上传发票</button>
    </form>  
<!--                             <div class="control-group js_uploadBox">
    <div class="btn-upload">
      <a href="javascript:void(0);"><i class="icon-upload-alt"></i><span class="js_uploadText">上传</span>图片</a>
      <input class="js_upFile" type="file" name="cover">
    </div>
</div> -->

</block>
<block name="script">
<!-- 图片上传插件 -->
<script src="__THEMES__/js/jquery.uploadView.js?v={:C('CURRENT_FILE_VERSION')}"></script>
<script type-"text/javascript">
 $(function(){

   fileselectclass_change();

 $("form").submit(function(e){
   if($('#fileImage').val() == ""){
    e.preventDefault();
    alert("请选择上传的发票");
  }
  });  

  })
  function  fileselectclass_change(){

   $('input[mark=last_file]').change(function(event) {
              var flag= false;
          debugger;
          $('input[class=fileselectclass]').each(function(index, el) {
             if($(this).val() == ""){
               flag = true;
             }
          });
          if(flag == true){
            return;
          }
        $(this).parent('form').children('input').removeAttr("mark");
        $(this).after('<input type="file" class="fileselectclass" mark = "last_file"  type="file" name="fileselect[]"/>');
        fileselectclass_change();
   });
   
  }

 
</script>
</block>


